package com.mlog.njyjy.ndop.share.zabbix.request.core;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.mlog.njyjy.ndop.share.zabbix.response.ZabbixResponse;

import java.util.Map;

/**
 * <p>
 *  request
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/6/29
 */
public interface ZabbixRequest<T extends ZabbixResponse> {

    /**
     * method
     * eg 'user.login'
     *
     * @return
     */
    String getMethod();

    /**
     * jsonrpc
     *
     * @return
     */
    String getJsonrpc();

    /**
     * @return id
     */
    int getId();

    /**
     * 请求的参数
     *
     * @return
     */
    Map<String, Object> getParams();

    /**
     * create new response
     *
     * @param responseBody
     * @param statusCode
     * @param reasonPhrase
     * @param gson
     * @return {@link ZabbixResponse}
     */
    T createNewResponse(String responseBody, int statusCode, String reasonPhrase, Gson gson);

}
